/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package SysAguas.dao;

import SysAguas.modelo.Endereco;
import java.util.List;

/**
 *
 * @author Heitor
 */
public class DAOEndereco extends DAOGenerico {

    
    
    public Endereco getEnderecoByHospede(Integer idHospede){

        Endereco toReturn =null;
        List<Endereco> list = null;
        String query = "select end from Endereco end join end.hospedeE hos" +
                " where hos.id = ?1";
        list = getLista(Endereco.class, query, idHospede);
        toReturn = list.get(0);
      //  System.out.println("\n\n"+toReturn.getRua()+"\n\n");
        return toReturn;



    }
}
